//
//  FirstModel.m
//  jiexi
//
//  Created by dllo on 15/11/9.
//  Copyright (c) 2015年 liyinkai. All rights reserved.
//

#import "FirstModel.h"
#import "SecondModel.h"
@implementation FirstModel

-(id)valueForUndefinedKey:(NSString *)key {
    return nil;
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"data"]) {
        NSArray *array = value;
        NSMutableArray *array2 = [[NSMutableArray alloc] init];
        for (NSDictionary *dic in array) {
            SecondModel *second = [[SecondModel alloc] init];
            [second setValuesForKeysWithDictionary:dic];
            [array2 addObject:second];
        }
        self.datasource = [[NSArray alloc] initWithArray:array2];
    }
}

@end
